home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / arts / kartsserver.h < prev    next >
Encoding:
C/C++ Source or Header  |  2005-09-10  |  2.6 KB  |  76 lines

  1. // Copyright (c) 2000-2001 Charles Samuels <charles@kde.org>
  2. //                         Neil Stevens <neil@qualityassistant.com>
  3. //
  4. // Permission is hereby granted, free of charge, to any person obtaining a copy
  5. // of this software and associated documentation files (the "Software"), to deal
  6. // in the Software without restriction, including without limitation the rights
  7. // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8. // copies of the Software, and to permit persons to whom the Software is
  9. // furnished to do so, subject to the following conditions:
  10. //
  11. // The above copyright notice and this permission notice shall be included in
  12. // all copies or substantial portions of the Software.
  13. //
  14. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
  17. // AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIAB\ILITY, WHETHER IN
  18. // AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  19. // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  20.  
  21. #ifndef KARTSSERVER_H
  22. #define KARTSSERVER_H
  23.  
  24. #include "kmedia2.h"
  25. #include <qobject.h>
  26. #include "soundserver.h"
  27. #include <kdelibs_export.h>
  28.  
  29. /**
  30.  * KArtsServer is a wrapper to conveniently get a reference to a SoundServer,
  31.  * and restart artsd when necessary, using the kcontrol settings.
  32.  *
  33.  * Of course we'd rather that artsd never crashed, and that all users start
  34.  * artsd on KDE startup, but at the very least there will always be third
  35.  * party PlayObjects that will crash.  So, this is necessary.
  36.  */
  37. class KDE_ARTS_EXPORT KArtsServer : public QObject
  38. {
  39. Q_OBJECT
  40.  
  41. public:
  42.     /**
  43.      * Create a new KArtsServer. Don't forget to create a KArtsDispatcher
  44.      * before using KArtsServer.
  45.      */
  46.     KArtsServer(QObject *parent = 0, const char *name = 0);
  47.     virtual ~KArtsServer(void);
  48.  
  49.     /**
  50.      * Get a verified reference to the SoundServerV2, (re)starting artsd
  51.      * using the kcontrol-specified settings if necessary.
  52.      *
  53.      * If the soundserver has changed since you called this method the last
  54.      * time (meaning artsd was restarted) restartedServer() will be emitted.
  55.      */
  56.     Arts::SoundServerV2 server(void);
  57.  
  58. signals:
  59.     /**
  60.      * This is emitted when the soundserver has been restarted (by this
  61.      * KArtsServer instance or outside). It is not
  62.      * emitted automatically when the soundserver comes up but only after
  63.      * your code calls server().
  64.      */
  65.     void restartedServer(void);
  66.  
  67. private:
  68.     KArtsServer(const KArtsServer &rhs);
  69.     KArtsServer &operator=(const KArtsServer &rhs);
  70.  
  71.     struct Data;
  72.     Data *d;
  73. };
  74.  
  75. #endif
  76.